package com.ifgostudio.framework.web.servlet.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

/**
 * <b>Description</b>:关键时候的暂时无法提供服务<br/>
 * <b>Author</b>: linxuexin<br/>
 * <b>Link</b>: Email:<a href="mailto:linxuexin0423@gmail.com">linxuexin0423@gmail.com</a>;Telephone:13799286849;QQ:30268646;林先生<br/>
 * <b>Copyright</b>: <a href="http://www.ifgostudio.com" target="_blank">www.ifgostudio.com</a> all rights reserved<br/>
 * <b>Information</b>: 对外承接网站制作,价格优惠,服务一流,强有力的技术支持,asp,Jsp,PHP,MySQL,Hibernate,Struts2,MS SQLServer,Oracle,jQuery,Css+div布局,Dhtml<br/>
 * <b>Create Date</b>: 2013-3-13 下午4:27:52<br/>
 * <b>Version</b>: Since JDK 1.6.0<br/>
 * <b>Package</b>: com.ifgostudio.framework.web.servlet
 */
public class StopServiceInterceptor implements HandlerInterceptor {

	private String openWeekDays;//开期的具体星期几
	private String openingTime;            //openingTime 属性指定开期的开始时间 
	private String closingTime;            //closingTime属性指定开期的结束时间  
	private String justOneMin;//关键1分钟不响应时间
	private String noOpenUrl;//未开期转向地址
	private String oneMinNoServiceUrl;//关键1分钟转向地址
	/* (non-Javadoc)
	 * @see org.springframework.web.servlet.HandlerInterceptor#preHandle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object)
	 */
	//preHandle()方法在业务处理器处理请求之前被调用
	/*这个方法在业务处理器处理请求之前被调用，在该方法中对用户请求request进行处理。
	 * 如果程序员决定该拦截器对请求进 行拦截处理后还要调用其他的拦截器，或者是业务处理器去进行处理，
	 * 则返回true；如果程序员决定不需要再调用其他的组件去处理请求，则返回false。*/
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response,
			Object handler) throws Exception {
		//TODO linxx 实现平时未开期时的处理及特殊1分钟的处理
		return false;
	}
	
	/* (non-Javadoc)
	 * @see org.springframework.web.servlet.HandlerInterceptor#afterCompletion(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, java.lang.Exception)
	 */
	//afterCompletion()方法在DispatcherServlet完全处理完请求后被调用
	/*这个方法在DispatcherServlet完全处理完请求后被调用，
	 * 可以在该方法中进行一些资源清理的操作。*/
	public void afterCompletion(HttpServletRequest request,
			HttpServletResponse response, Object handler, Exception exception)
			throws Exception {
		

	}

	/* (non-Javadoc)
	 * @see org.springframework.web.servlet.HandlerInterceptor#postHandle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.web.servlet.ModelAndView)
	 */
	//postHandle()方法在业务处理器处理请求之后被调用
	/*这个方法在业务处理器处理完请求后，但是DispatcherServlet向客户端返回请求前被调用，
	 * 在该方法中对用户请求request进行处理。*/
	public void postHandle(HttpServletRequest request, HttpServletResponse response,
			Object arg2, ModelAndView modelAndView) throws Exception {
		

	}

	public String getOpenWeekDays() {
		return openWeekDays;
	}

	public void setOpenWeekDays(String openWeekDays) {
		this.openWeekDays = openWeekDays;
	}

	public String getOpeningTime() {
		return openingTime;
	}

	public void setOpeningTime(String openingTime) {
		this.openingTime = openingTime;
	}

	public String getClosingTime() {
		return closingTime;
	}

	public void setClosingTime(String closingTime) {
		this.closingTime = closingTime;
	}

	public String getJustOneMin() {
		return justOneMin;
	}

	public void setJustOneMin(String justOneMin) {
		this.justOneMin = justOneMin;
	}

	public String getNoOpenUrl() {
		return noOpenUrl;
	}

	public void setNoOpenUrl(String noOpenUrl) {
		this.noOpenUrl = noOpenUrl;
	}

	public String getOneMinNoServiceUrl() {
		return oneMinNoServiceUrl;
	}

	public void setOneMinNoServiceUrl(String oneMinNoServiceUrl) {
		this.oneMinNoServiceUrl = oneMinNoServiceUrl;
	}
	
}
